/*
Copyright [2023] [fuwen_soft]
*/
package vip.xiaonuo.sys.modular.sysappinfoimages.controller;

import vip.xiaonuo.core.annotion.BusinessLog;
import vip.xiaonuo.core.annotion.Permission;
import vip.xiaonuo.core.enums.LogAnnotionOpTypeEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import vip.xiaonuo.core.pojo.page.PageResult;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.validation.annotation.Validated;
import vip.xiaonuo.core.annotion.version.AdminVersionSwagger;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import vip.xiaonuo.sys.core.msg.Result;
import vip.xiaonuo.sys.modular.sysappinfoimages.entity.SysAppInfoImages;
import vip.xiaonuo.sys.modular.sysappinfoimages.param.SysAppInfoImagesParam;
import vip.xiaonuo.sys.modular.sysappinfoimages.service.SysAppInfoImagesService;

import javax.annotation.Resource;
import java.util.List;

import static vip.xiaonuo.sys.core.msg.ResultUtils.success;

/**
 * APP示例图控制器
 *
 * @author yanwei
 * @date 2023-03-21 12:07:25
 */
@RestController
@Api(tags = "后台管理 APP示例图 相关APIS")
@AdminVersionSwagger
public class SysAppInfoImagesController {

    @Resource
    private SysAppInfoImagesService sysAppInfoImagesService;

    /**
     * 查询APP示例图
     *
     * @author yanwei
     * @date 2023-03-21 12:07:25
     */
    @Permission
    @GetMapping("/sysAppInfoImages/page")
    @BusinessLog(title = "APP示例图_查询", opType = LogAnnotionOpTypeEnum.QUERY)
    @ApiOperation("APP示例图_查询")
    public Result<PageResult<SysAppInfoImages>> page(SysAppInfoImagesParam sysAppInfoImagesParam) {
        PageResult<SysAppInfoImages> page = sysAppInfoImagesService.page(sysAppInfoImagesParam);
        return success(page);
    }

    /**
     * 添加APP示例图
     *
     * @author yanwei
     * @date 2023-03-21 12:07:25
     */
    @Permission
    @PostMapping("/sysAppInfoImages/add")
    @BusinessLog(title = "APP示例图_增加", opType = LogAnnotionOpTypeEnum.ADD)
    @ApiOperation("APP示例图_增加")
    public Result add(@RequestBody @Validated(SysAppInfoImagesParam.add.class) SysAppInfoImagesParam sysAppInfoImagesParam) {
            sysAppInfoImagesService.add(sysAppInfoImagesParam);
        return success();
    }

    /**
     * 删除APP示例图，可批量删除
     *
     * @author yanwei
     * @date 2023-03-21 12:07:25
     */
    @Permission
    @PostMapping("/sysAppInfoImages/delete")
    @BusinessLog(title = "APP示例图_删除", opType = LogAnnotionOpTypeEnum.DELETE)
    @ApiOperation("APP示例图_删除")
    public Result delete(@RequestBody @Validated(SysAppInfoImagesParam.delete.class) List<SysAppInfoImagesParam> sysAppInfoImagesParamList) {
            sysAppInfoImagesService.delete(sysAppInfoImagesParamList);
        return success();
    }

    /**
     * 编辑APP示例图
     *
     * @author yanwei
     * @date 2023-03-21 12:07:25
     */
    @Permission
    @PostMapping("/sysAppInfoImages/edit")
    @BusinessLog(title = "APP示例图_编辑", opType = LogAnnotionOpTypeEnum.EDIT)
    @ApiOperation("APP示例图_编辑")
    public Result edit(@RequestBody @Validated(SysAppInfoImagesParam.edit.class) SysAppInfoImagesParam sysAppInfoImagesParam) {
            sysAppInfoImagesService.edit(sysAppInfoImagesParam);
        return success();
    }

    /**
     * 查看APP示例图
     *
     * @author yanwei
     * @date 2023-03-21 12:07:25
     */
    @Permission
    @GetMapping("/sysAppInfoImages/detail")
    @BusinessLog(title = "APP示例图_查看", opType = LogAnnotionOpTypeEnum.DETAIL)
    @ApiOperation("APP示例图_查看")
    public Result<SysAppInfoImages> detail(@Validated(SysAppInfoImagesParam.detail.class) SysAppInfoImagesParam sysAppInfoImagesParam) {
        SysAppInfoImages detail =   sysAppInfoImagesService.detail(sysAppInfoImagesParam);
        return success(detail);
    }

    /**
     * APP示例图列表
     *
     * @author yanwei
     * @date 2023-03-21 12:07:25
     */
    @Permission
    @GetMapping("/sysAppInfoImages/list")
    @BusinessLog(title = "APP示例图_列表", opType = LogAnnotionOpTypeEnum.QUERY)
    @ApiOperation("APP示例图_列表")
    public Result<List<SysAppInfoImages>> list(SysAppInfoImagesParam sysAppInfoImagesParam) {
        List<SysAppInfoImages> list  =   sysAppInfoImagesService.list(sysAppInfoImagesParam);
        return success(list);
    }

    /**
     * 导出系统用户
     *
     * @author yanwei
     * @date 2023-03-21 12:07:25
     */
    @Permission
    @GetMapping("/sysAppInfoImages/export")
    @BusinessLog(title = "APP示例图_导出", opType = LogAnnotionOpTypeEnum.EXPORT)
    @ApiOperation("APP示例图_导出")
    public void export(SysAppInfoImagesParam sysAppInfoImagesParam) {
        sysAppInfoImagesService.export(sysAppInfoImagesParam);
    }

}
